package com.kurumi.medical.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kurumi.medical.component.Const;
import com.kurumi.medical.component.MyConfig;
import com.kurumi.medical.service.Export305InterfaceTestService;
import com.kurumi.medical.service.HospitalVisit305Service;
/**
 * 305接口测试Service
 * @author lyh
 *
 */
@Service
public class Export305InterfaceTestServiceImpl implements Export305InterfaceTestService {

	@Autowired
	private HospitalVisit305Service hospitalVisitService;
	
	@Autowired
	private MyConfig myConfig;
	
	@Override
	public List<Map<String,Object>> nurseSystemInterfaceTest(String mrId, String visitNumber) {
		// TODO Auto-generated method stub
		List<Map<String,Object>> interfaceDatas = new ArrayList<Map<String,Object>>();
		String firstGuid = "A00001_test";
		String[] pdfFileSuffix=Const.PDF_FILE_SUFFIX;
		Map<String,Map<String,Object>> nurseRecordMap = new HashMap<>();
		for (String fileSuffix : pdfFileSuffix) {
			if("tiwen".equals(fileSuffix)){
				Map<String,Object> map= new HashMap<>();
				map = hospitalVisitService.getPdfRecordSheetFormNurseSystem(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber, firstGuid, fileSuffix);
				interfaceDatas.add(map);
			}
			
			if("xuetcd".equals(fileSuffix)){
				Map<String,Object> map= new HashMap<>();
				/*try {
					map = PDFUtil.pdfRecordSheet(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				} catch (IOException e) {
					map= new HashMap<>();
				}*/
				map = hospitalVisitService.getPdfRecordSheetFormNurseSystem(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				
				interfaceDatas.add(map);
			}
			
			if("xindjc".equals(fileSuffix)){
				Map<String,Object> map= new HashMap<>();
				/*try {
					temperatureRecord = PDFUtil.pdfRecordSheet(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				} catch (IOException e) {
					temperatureRecord= new HashMap<>();
				}*/
				map = hospitalVisitService.getPdfRecordSheetFormNurseSystem(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				
				interfaceDatas.add(map);
			}
			
			if("smtzgc".equals(fileSuffix)){
				/*try {
					temperatureRecord = PDFUtil.pdfRecordSheet(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				} catch (IOException e) {
					temperatureRecord= new HashMap<>();
				}*/
				Map<String,Object> map = hospitalVisitService.getPdfRecordSheetFormNurseSystem(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				
				interfaceDatas.add(map);
			}
			
			if("bingzhj".equals(fileSuffix)){
				Map<String,Object> map= new HashMap<>();
				/*try {
					map = PDFUtil.pdfRecordSheet(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				} catch (IOException e) {
					map= new HashMap<>();
				}*/
				map = hospitalVisitService.getPdfRecordSheetFormNurseSystem(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				
				interfaceDatas.add(map);
			}
			
			if("tebiehj".equals(fileSuffix)){
				Map<String,Object> map= new HashMap<>();
				/*try {
					map = PDFUtil.pdfRecordSheet(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				} catch (IOException e) {
					map= new HashMap<>();
				}*/
				map = hospitalVisitService.getPdfRecordSheetFormNurseSystem(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				
				interfaceDatas.add(map);
			}
			
			if("bingwhj".equals(fileSuffix)){
				Map<String,Object> map= new HashMap<>();
				/*try {
					map = PDFUtil.pdfRecordSheet(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				} catch (IOException e) {
					map= new HashMap<>();
				}*/
				map = hospitalVisitService.getPdfRecordSheetFormNurseSystem(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				
				interfaceDatas.add(map);
			}
			
			if("yibanhj".equals(fileSuffix)){
				Map<String,Object> map= new HashMap<>();
				/*try {
					map = PDFUtil.pdfRecordSheet(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				} catch (IOException e) {
					map= new HashMap<>();
				}*/
				map = hospitalVisitService.getPdfRecordSheetFormNurseSystem(myConfig.getCmisServerHost(), myConfig.getCmisFileLocalDir(), mrId, visitNumber.toString(), firstGuid, fileSuffix);
				
				interfaceDatas.add(map);
			}
		}
		return interfaceDatas;
	}

}
